<template name="home">
	<!-- 认证首页 -->
	<view class="home">
		<!-- 主页的头部部分 -->
		<view class="h_header">
			<view class="h_bg">
				<div class="h_bg1">
					<text class="bg1_tltle">Max Loan Amount Up To</text>
					<text class="bg1_mony">
						<span v-if="types!=3">₹</span>
						<text v-if="types==3" class="smell-bg1_mony">Information is not yet complete</text>
						<text v-else>50000~1000000</text>
					</text>
					<text class="bgl_min">Minmum interest 0.04% INR</text>
				</div>
			</view>
			<view class="apply" @click="authentication">
				Apply Now
			</view>
		</view>
		<!-- High Pass Rate部分 -->
		<view class="h_count">
			<template>
				<view class="h_lists">
					<image src="../../static/home/h_list1.png" mode=""></image>
					<text class="list_text">High Pass Rate</text>
				</view>
				<view class="h_lists">
					<image src="../../static/home/h_list2.png" mode=""></image>
					<text class="list_text">Low Interest</text>
				</view>
				<view class="h_lists">
					<image src="../../static/home/h_list3.png" mode=""></image>
					<text class="list_text">Quick Loan</text>
				</view>
			</template>
		</view>
		<!-- Three Steps To Loan部分 -->
		<view class="h_there">
			<text class="three_title">Three Steps To Loan</text>
			<view class="there_lists">
				<template>
					<view class="there_list">
						<image src="../../static/home/h_there-list1.png" mode=""></image>
						<text class="list_text">Infomation</text>
					</view>
					<view class="jiantou-box">
						<view class="line">
						</view>
						<view class="sanjiao">
						</view>
					</view>
					<view class="there_list">
						<image src="../../static/home/h_there-list2.png" mode=""></image>
						<text class="list_text">Infomation</text>
					</view>
					<view class="jiantou-box">
						<view class="line">
						</view>
						<view class="sanjiao">
						</view>
					</view>
					<view class="there_list">
						<image src="../../static/home/h_there-list3.png" mode=""></image>
						<text class="list_text">Infomation</text>
					</view>
				</template>
			</view>
			<view class="h_get" @click="check">
				Go
			</view>
		</view>
		<!-- 声明声则 -->
		<view class="h_statement">
			Online Service 1 Compliance agency 7*8 service
		</view>

	</view>
</template>

<script>
	import configService from '@/common/service/config.service.js';
	import {
		getRawKey,
		getEncryptString,
		getDecryptString
	} from "../../defaut.js"
	export default {
		name: 'home',
		data() {
			return {
				password: 'universa',
				curruser: {},
				types: String(uni.getStorageSync('types')) ,
			}
		},
	    onLoad: function () {
		// console.log(this.$Route.query.types)
			// uni.setStorageSync('types',this.$Route.query.types)
	    },
		mounted() {
			this.getcurruser()
		},
		methods: {
			getcurruser() {
				var _this = this
				this.$http.get("user/v1/getcurruser", {}).then(res => {
					if (res.data.status == 200) {
						_this.curruser = JSON.parse(getDecryptString(res.data.data, this.$password()))
						 console.log(_this.curruser);
					}
				})
			},
			authentication() {
				uni.setStorageSync('infoAuthStatus',this.curruser.infoAuthStatus)
				if (this.curruser.infoAuthStatus == 0||this.curruser.infoAuthStatus == 3) {
					// 认证界面
					// this.$Router.replaceAll({
					//   name: "annotationDetail",
					//   params: this.types,
					// });
					uni.navigateTo({
						url: "/pages/authentication/authenticationone"
					})
					// uni.$u.toast('Please authenticate first');
				} else if (this.curruser.infoAuthStatus == 1) {
					// 额度选择界面
					uni.navigateTo({
						// url: "/pages/quotaselection/quotaselection"
						url:'/pages/huxing/huxing'
					})
				} else if (this.curruser.infoAuthStatus == 2) {
					// 额度审核界面
					uni.navigateTo({
						url: "/pages/backupcopy/backupcopyn"
					})
					uni.$u.toast('Please wait for the verification result');
				}
			},
			check() {
				if (this.curruser.infoAuthStatus == 0||this.curruser.infoAuthStatus == 3) {
					// 认证界面
					// uni.navigateTo({
					// 	url: "/pages/authentication/authenticationone"
					// })
					uni.reLaunch({
					    url:'/pages/authentication/authenticationone'
					    })
				} else if (this.curruser.infoAuthStatus == 1) {
					// 额度选择界面
					uni.reLaunch({
					    // url:'/pages/quotaselection/quotaselection'
						  url:'/pages/huxing/huxing'
					    })
					uni.$u.toast('Verification complete, you are now authenticated');
				} else if (this.curruser.infoAuthStatus == 2) {
					// 额度审核界面
					uni.reLaunch({
					    url:'/pages/backupcopy/backupcopyn'
					    })
					// uni.navigateTo({
					// 	url: "/pages/backupcopy/backupcopyn"
					// })
					uni.$u.toast('Please wait for the verification result');
				}
			},
		},
	}
</script>

<style scoped>
	page {
		/* height: 100%; */
	}

	.home {
		width: 100%;
		height: 100%;
		/* box-sizing: border-box; */
		padding-bottom: 62rpx;
	}

	/* 头部额度部分 */
	.h_header {
		width: 100%;
		height: 402rpx;
		background-color: #D53030;
		padding-top: 82rpx;
		box-sizing: border-box;
		position: relative;


	}

	.h_header .h_bg {
		width: 90.13%;
		height: 100%;
		margin: auto;
		border-top-left-radius: 28rpx;
		border-top-right-radius: 28rpx;
		background-color: #F6D0D0;
		position: relative;
	}

	.h_header .h_bg .h_bg1 {
		width: 100%;
		height: 91%;
		position: absolute;
		top: 30rpx;
		left: 30rpx;
		display: flex;
		flex-direction: column;
		background-color: #F7E2E2;
		border-top-left-radius: 28rpx;
		border-top-right-radius: 28rpx;
		padding-top: 24rpx;
		padding-left: 42rpx;
		box-sizing: border-box;
	}

	.h_header .h_bg .h_bg1 .bg1_tltle {
		font-size: 32rpx;
		font-family: "SourceHanSansSC-Regular", "SourceHanSansSC";
		font-weight: 500;
		color: #3A3A3A;
		line-height: 44rpx;
	}

	.h_header .h_bg .h_bg1 .bg1_mony {
		font-size: 60rpx;
		font-family: "SourceHanSansSC-Bold", "SourceHanSansSC";
		font-weight: bold;
		color: #D53030;
		line-height: 84rpx;
		margin-top: 12rpx;
		margin-bottom: 20rpx;
	}
	.smell-bg1_mony{
		font-size: 30rpx;
		font-family: "SourceHanSansSC-Bold", "SourceHanSansSC";
		font-weight: bold;
		color: #D53030;
		line-height: 84rpx;
		margin-top: 12rpx;
		margin-bottom: 20rpx;
	}

	.h_header .h_bg .h_bg1 .bg1_min {
		font-size: 30rpx;
		font-family: "SourceHanSansSC-Regular", " SourceHanSansSC";
		font-weight: 400;
		color: #000000;
		line-height: 34rpx;
	}

	.apply {
		position: absolute;
		top: 344rpx;
		right: 0;
		border-top-left-radius: 60rpx;
		border-bottom-left-radius: 60rpx;
		width: 344rpx;
		height: 106rpx;
		background-color: #D53030;
		text-align: center;
		line-height: 106rpx;
		font-size: 38rpx;
		font-family: "SourceHanSansSC-Regular", "SourceHanSansSC";
		font-weight: 400;
		color: #FFFFFF;
	}

	/* 列表 */
	.h_count {
		display: flex;
		margin-right: 24rpx;
		margin-left: 24rpx;
		justify-content: space-around;
		border-bottom: 2rpx solid rgba(194, 155, 80, 0.5);
		height: 376rpx;
		align-items: center;
		box-sizing: border-box;
	}

	.h_count .h_lists {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.h_count .h_lists image {
		width: 114rpx;
		height: 114rpx;
		margin-bottom: 34rpx;
	}

	.h_count .h_lists .list_text {
		font-size: 22rpx;
		font-family: SourceHanSansSC-Regular, SourceHanSansSC;
		font-weight: 400;
		color: #000000;
		line-height: 32rpx;
	}

	/* there部分 */
	.h_there {
		width: 100%;
		padding-left: 24rpx;
		padding-right: 22rpx;
		padding-top: 54rpx;
	}

	.h_there .three_title {
		font-size: 32rpx;
		font-family: "SourceHanSansSC-Medium", "SourceHanSansSC";
		font-weight: 600;
		color: #000000;
		line-height: 48rpx;
	}

	.there_lists {
		background: rgba(253, 243, 243, 0.6);
		box-shadow: 0px 4rpx 12rpx 0px rgba(196, 196, 196, 0.16);
		border-radius: 12rpx;
		display: flex;
		margin-top: 38rpx;
		margin-bottom: 68rpx;
		justify-content: space-around;
		align-items: center;
		height: 238rpx;
	}

	.there_lists .there_list {
		display: flex;
		flex-direction: column;
		align-items: center;

	}

	.there_lists .there_list image {
		width: 88rpx;
		height: 88rpx;
		margin-bottom: 18rpx;

	}
	.jiantou-box{
		display: flex;
		align-items: center;
		transform: translate(0rpx,-25rpx);
		margin: 0rpx -15rpx;
	}
	.line{
		width: 84rpx;
		height: 1rpx;
		background-color: #D53030;
	}
	.sanjiao{
		width:0;
		height:0;
		border-left:12px solid #D53030 ;
		border-top:6px solid transparent;
		border-bottom:6px solid transparent;
	}

	/* GO */
	.h_get {
		height: 104rpx;
		background: #D53030;
		border-radius: 12rpx;
		color: #fff;
		line-height: 104rpx;
		text-align: center;
		font-size: 32rpx;
		font-family: " SourceHanSansSC-Bold", "SourceHanSansSC";
		font-weight: bold;
		color: #FFFFFF;
		animation: fade 1s linear  forwards infinite; //  保持最终状态
	}
	@keyframes fade {
		0% {
			transform: scale(1);
		}
	
		25% {
			transform: scale(1.02);
		}
		50% {
			transform: scale(1.05);
		}
		75% {
			transform: scale(1.02);
		}
		100% {
			transform: scale(1);
		}
	}
	

	/* 声则声明 */
	.h_statement {
		width: 100%;
		text-align: center;
		font-size: 24rpx;
		font-family: "SourceHanSansSC-Regular", "SourceHanSansSC";
		font-weight: 400;
		color: #CECECE;
		line-height: 34rpx;
		margin-top: 98rpx;
	}
</style>